//
//  UIView+Screen.m
//  doubanFun
//
//  Created by bing on 16/4/1.
//  Copyright © 2016年 bing. All rights reserved.
//

#import "UIView+Screen.h"
#import <CoreGraphics/CoreGraphics.h>

@implementation UIView (Screen)
- (UIImage *)convertViewToImage

{
    
    UIGraphicsBeginImageContext(self.bounds.size);
    
    [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];
    
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    return image;
    
}

@end
